package main

import (
	"fmt"
	"net/http"
	"time"
)

func main() {
	// // 回调函数
	// http.HandleFunc("/hello", process)

	// // 监听
	// http.ListenAndServe("127.0.0.1:8000", nil)
	now := time.Now()
	fmt.Println(now.Format("2006-01-02 15:04:05"))
}

func process(w http.ResponseWriter, r *http.Request) {
	fmt.Println(r.RemoteAddr + "连接成功！")
	fmt.Println("请求方式:", r.Method)
	fmt.Println("URL:", r.URL.Path)
	fmt.Println("header:", r.Header)
	fmt.Println("body:", r.Body)

	w.Write([]byte("你好啊, 我在公司摸鱼学go"))
}
